package day240529;

import java.io.File;

public class Test4 {
    public static void main(String[] args) {
        File root = new File("src/day240519_report");
        String s = "";
        showByTree(root,s);
    }

    private static void showByTree(File file,String s){
        s += "--";
        for(File f : file.listFiles()){
            if(f.isDirectory()){
                System.out.println(s + f.getName());
                showByTree(f,s);
            }
            else {
                System.out.println(s + f.getName() + " 文件大小：" + f.length() + "字节");
            }
        }
    }
}
